package com.bba.manager.order.controller;

import com.bba.manager.common.model.order.Purchase;
import com.bba.manager.common.util.ResponseVO;
import com.bba.manager.order.service.impl.PurchaseDetailsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 采购详情表 前端控制器
 * </p>
 *
 * @author zzy
 * @since 2025-08-12
 */
@RestController
@RequestMapping("/purchaseDetails")
public class PurchaseDetailsController {
    @Autowired
    private PurchaseDetailsServiceImpl purchaseDetailsService;
    @GetMapping("/purchaseId")
    public ResponseVO getByPurchaseId(@RequestParam Long purchaseId){
        return ResponseVO.success(purchaseDetailsService.selectByPurchaseId(purchaseId));
    }
    @DeleteMapping("/deleted/{purchaseId}")
    public  ResponseVO deletedByPurchaseId(@PathVariable Long purchaseId){
        purchaseDetailsService.deletedByPurchaseId(purchaseId);
        return ResponseVO.success();
    }

}
